package com.dgw.springbootmail.controller;

import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: springboot-sendmail
 * @description:
 * @author: Mr.Dai
 * @create: 2020-03-01 14:22
 **/
@RestController
public class CommonErrorController implements ErrorController {

    private final  String  ERROR_PATH="/error";

    @Override
    public String getErrorPath() {
        return ERROR_PATH;
    }
    @GetMapping(value = ERROR_PATH)
    public String handleError(){
        System.out.println(getErrorPath());
        return "error";
    }
}
